class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.w: F = 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.u: E = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

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

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

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

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

j.x = l
j.w = l
j.t = k
c.o = l
h.u = g
h.o = g
h.y = k
a.y = j
g.o = j
g.v = h
l.p = k
l.z = c
e.y = j
k.p = l
k.z = c
assert a.y.t.z.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.w: F = 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.u: E = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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