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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: A = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.txt = txt

d = A("d")
m = B("m")
e = C("e")
b = D("b")
l = E("l")
n = F("n")
c = C("c")
g = C("g")
j = E("j")
k = A("k")

d.z = n
d.y = k
d.s = m
m.t = e
m.v = n
m.w = b
m.s = k
e.t = m
e.w = d
e.q = n
e.o = k
b.u = m
l.s = j
l.p = n
l.q = n
l.t = b
n.p = g
n.u = e
c.t = m
c.w = d
c.q = n
c.o = k
g.t = m
g.w = k
g.q = n
g.o = d
j.s = l
j.p = n
j.q = n
j.t = b
k.z = n
k.y = d
k.s = m
assert g.q.p.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: A = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: A = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.txt = txt

d = A("d")
m = B("m")
e = C("e")
b = D("b")
l = E("l")
n = F("n")
c = C("c")
g = C("g")
j = E("j")
k = A("k")

d.z = n
d.y = k
d.s = m
m.t = e
m.v = n
m.w = b
m.s = k
e.t = m
e.w = d
e.q = n
e.o = k
b.u = m
l.s = j
l.p = n
l.q = n
l.t = b
n.p = g
n.u = e
c.t = m
c.w = d
c.q = n
c.o = k
g.t = m
g.w = k
g.q = n
g.o = d
j.s = l
j.p = n
j.q = n
j.t = b
k.z = n
k.y = d
k.s = m
assert g.q.p.t.w.txt == "b"