class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: D = None
        self.w: F = None
        self.t: F = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: D = None
        self.w: F = None
        self.t: F = None
        self.x: A = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

a.w = e
a.z = g
d.z = e
d.v = a
f.r = a
f.z = a
f.w = g
f.q = e
f.s = d
f.v = l
c.z = g
c.u = k
c.w = e
c.t = e
c.x = a
c.p = a
m.y = k
e.w = m
k.z = f
k.u = c
k.w = e
k.t = e
k.x = a
k.p = a
g.r = a
g.z = a
g.w = f
g.q = e
g.s = d
g.v = l
l.y = k
b.z = e
b.v = a
assert d.z.w.y.t.w.txt == "m"