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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: F = None
        self.y: E = None
        self.u: B = None
        self.r: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

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

d.q = e
d.r = k
h.w = e
h.v = g
h.r = g
h.y = k
h.u = n
h.z = a
m.x = d
m.s = e
m.r = e
m.w = e
m.u = k
m.v = a
a.o = m
a.q = h
k.w = m
g.z = b
e.x = j
e.s = m
e.r = m
e.w = m
e.u = b
e.v = a
j.q = e
j.r = k
n.w = m
n.v = g
n.r = g
n.y = k
n.u = h
n.z = a
b.w = e
assert d.r.w.v.q.u.r.z.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: F = None
        self.y: E = None
        self.u: B = None
        self.r: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

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

d.q = e
d.r = k
h.w = e
h.v = g
h.r = g
h.y = k
h.u = n
h.z = a
m.x = d
m.s = e
m.r = e
m.w = e
m.u = k
m.v = a
a.o = m
a.q = h
k.w = m
g.z = b
e.x = j
e.s = m
e.r = m
e.w = m
e.u = b
e.v = a
j.q = e
j.r = k
n.w = m
n.v = g
n.r = g
n.y = k
n.u = h
n.z = a
b.w = e
assert d.r.w.v.q.u.r.z.w.s.txt == "m"