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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: B = None
        self.x: D = None
        self.u: E = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: B = None
        self.x: D = None
        self.u: E = None
        self.p: B = None
        self.txt = txt

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

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