class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.r: E = None
        self.w: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

l = A("l")
a = B("a")
j = C("j")
b = D("b")
k = E("k")
i = F("i")
c = B("c")
e = C("e")
g = B("g")
h = E("h")

l.q = j
l.p = b
l.y = i
l.z = i
a.q = l
a.p = l
a.s = h
a.o = b
a.w = b
a.z = k
j.s = k
j.p = k
j.t = l
j.u = l
j.x = e
j.o = g
b.x = j
k.s = h
k.v = h
k.r = h
k.w = j
k.o = a
i.r = g
i.p = b
i.y = a
i.z = l
c.q = l
c.p = l
c.s = h
c.o = b
c.w = b
c.z = k
e.s = h
e.p = h
e.t = l
e.u = l
e.x = j
e.o = g
g.q = l
g.p = l
g.s = k
g.z = k
g.o = b
g.w = b
h.s = k
h.v = k
h.r = k
h.w = j
h.o = a
assert l.p.x.x.t.p.x.p.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.r: E = None
        self.w: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

l = A("l")
a = B("a")
j = C("j")
b = D("b")
k = E("k")
i = F("i")
c = B("c")
e = C("e")
g = B("g")
h = E("h")

l.q = j
l.p = b
l.y = i
l.z = i
a.q = l
a.p = l
a.s = h
a.o = b
a.w = b
a.z = k
j.s = k
j.p = k
j.t = l
j.u = l
j.x = e
j.o = g
b.x = j
k.s = h
k.v = h
k.r = h
k.w = j
k.o = a
i.r = g
i.p = b
i.y = a
i.z = l
c.q = l
c.p = l
c.s = h
c.o = b
c.w = b
c.z = k
e.s = h
e.p = h
e.t = l
e.u = l
e.x = j
e.o = g
g.q = l
g.p = l
g.s = k
g.z = k
g.o = b
g.w = b
h.s = k
h.v = k
h.r = k
h.w = j
h.o = a
assert l.p.x.x.t.p.x.p.o.w.txt == "b"