class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

e.u = h
d.v = h
d.p = e
m.v = h
m.s = h
m.o = j
m.t = e
i.t = m
i.s = e
i.z = h
h.z = j
h.q = j
h.x = a
j.q = i
j.u = d
j.x = d
a.v = h
a.s = h
a.o = j
a.t = e
assert e.u.z.q.t.t.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

e.u = h
d.v = h
d.p = e
m.v = h
m.s = h
m.o = j
m.t = e
i.t = m
i.s = e
i.z = h
h.z = j
h.q = j
h.x = a
j.q = i
j.u = d
j.x = d
a.v = h
a.s = h
a.o = j
a.t = e
assert e.u.z.q.t.t.u.x.txt == "a"