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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: D = None
        self.o: A = None
        self.y: F = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

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

l = A("l")
i = B("i")
e = C("e")
h = D("h")
f = E("f")
g = F("g")
j = F("j")

l.z = j
l.q = j
i.x = l
e.t = j
h.t = f
h.z = i
h.x = j
f.w = g
f.y = g
f.t = g
f.x = h
f.o = l
f.r = e
g.q = i
g.v = e
g.x = e
g.s = j
j.q = i
j.v = e
j.x = e
j.s = g
assert h.t.x.x.q.x.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: D = None
        self.o: A = None
        self.y: F = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

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

l = A("l")
i = B("i")
e = C("e")
h = D("h")
f = E("f")
g = F("g")
j = F("j")

l.z = j
l.q = j
i.x = l
e.t = j
h.t = f
h.z = i
h.x = j
f.w = g
f.y = g
f.t = g
f.x = h
f.o = l
f.r = e
g.q = i
g.v = e
g.x = e
g.s = j
j.q = i
j.v = e
j.x = e
j.s = g
assert h.t.x.x.q.x.q.v.txt == "e"