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

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

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

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

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

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

e = A("e")
g = B("g")
j = C("j")
c = D("c")
l = E("l")
a = F("a")
h = D("h")

e.o = g
e.w = j
e.y = a
e.v = l
e.r = l
e.z = c
g.p = j
j.x = c
j.w = c
j.q = l
c.t = e
c.y = l
l.y = j
a.o = h
h.t = e
h.y = l
assert a.o.y.y.w.t.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.y: F = None
        self.v: E = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

e = A("e")
g = B("g")
j = C("j")
c = D("c")
l = E("l")
a = F("a")
h = D("h")

e.o = g
e.w = j
e.y = a
e.v = l
e.r = l
e.z = c
g.p = j
j.x = c
j.w = c
j.q = l
c.t = e
c.y = l
l.y = j
a.o = h
h.t = e
h.y = l
assert a.o.y.y.w.t.o.p.txt == "j"