class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.x: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: C = None
        self.o: E = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

a = A("a")
n = B("n")
h = C("h")
b = D("b")
g = E("g")
f = F("f")
l = B("l")
d = A("d")
c = D("c")

a.u = d
a.s = b
n.t = c
n.w = c
n.x = c
n.q = c
h.q = f
h.o = g
h.v = a
b.t = g
b.s = h
b.w = l
b.x = a
g.p = b
g.y = f
f.p = b
f.w = h
f.q = h
f.o = g
f.s = l
l.t = b
l.q = b
l.w = c
l.x = c
d.u = a
d.s = c
c.t = g
c.s = h
c.w = l
c.x = d
assert l.q.s.q.o.y.p.s.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.x: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: C = None
        self.o: E = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

a = A("a")
n = B("n")
h = C("h")
b = D("b")
g = E("g")
f = F("f")
l = B("l")
d = A("d")
c = D("c")

a.u = d
a.s = b
n.t = c
n.w = c
n.x = c
n.q = c
h.q = f
h.o = g
h.v = a
b.t = g
b.s = h
b.w = l
b.x = a
g.p = b
g.y = f
f.p = b
f.w = h
f.q = h
f.o = g
f.s = l
l.t = b
l.q = b
l.w = c
l.x = c
d.u = a
d.s = c
c.t = g
c.s = h
c.w = l
c.x = d
assert l.q.s.q.o.y.p.s.o.p.txt == "b"