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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.x: A = None
        self.z: A = None
        self.y: C = None
        self.txt = txt

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

e.x = m
e.r = m
e.y = l
e.z = l
e.s = f
d.o = a
f.p = a
f.r = a
f.w = e
f.q = m
h.q = m
l.y = m
l.s = c
l.p = f
l.x = e
l.t = e
a.u = l
a.s = f
a.y = f
a.x = e
a.z = c
m.q = h
c.x = h
c.y = l
c.z = l
c.s = f
c.r = m
assert a.s.r.z.r.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: E = None
        self.s: C = None
        self.r: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.x: A = None
        self.z: A = None
        self.y: C = None
        self.txt = txt

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

e.x = m
e.r = m
e.y = l
e.z = l
e.s = f
d.o = a
f.p = a
f.r = a
f.w = e
f.q = m
h.q = m
l.y = m
l.s = c
l.p = f
l.x = e
l.t = e
a.u = l
a.s = f
a.y = f
a.x = e
a.z = c
m.q = h
c.x = h
c.y = l
c.z = l
c.s = f
c.r = m
assert a.s.r.z.r.q.q.q.txt == "h"