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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.z: B = None
        self.t: B = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.z: B = None
        self.t: B = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

e.z = b
e.v = m
e.w = m
e.y = d
b.r = g
h.x = d
h.q = d
h.z = b
h.t = b
h.r = b
n.q = e
n.r = k
f.u = b
f.t = b
f.r = g
l.x = m
l.t = k
k.x = e
k.t = g
g.x = e
g.t = k
d.x = h
d.q = h
d.z = b
d.t = b
d.r = b
m.z = b
m.v = e
m.w = e
m.y = h
assert d.r.r.x.w.y.txt == "h"