class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: A = None
        self.v: F = None
        self.y: F = None
        self.t: A = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: A = None
        self.v: F = None
        self.o: A = None
        self.y: F = None
        self.txt = txt

n = A("n")
i = B("i")
l = C("l")
b = D("b")
j = E("j")
c = F("c")
g = F("g")
k = D("k")

n.x = c
n.p = i
n.v = l
n.w = b
i.z = c
i.v = c
i.y = c
i.o = n
i.t = n
i.q = n
l.q = i
b.u = c
j.p = c
c.u = l
c.w = n
c.o = n
c.v = g
c.y = g
g.u = l
g.w = n
g.o = n
g.v = c
g.y = c
k.u = c
assert k.u.u.q.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: A = None
        self.v: F = None
        self.y: F = None
        self.t: A = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: A = None
        self.v: F = None
        self.o: A = None
        self.y: F = None
        self.txt = txt

n = A("n")
i = B("i")
l = C("l")
b = D("b")
j = E("j")
c = F("c")
g = F("g")
k = D("k")

n.x = c
n.p = i
n.v = l
n.w = b
i.z = c
i.v = c
i.y = c
i.o = n
i.t = n
i.q = n
l.q = i
b.u = c
j.p = c
c.u = l
c.w = n
c.o = n
c.v = g
c.y = g
g.u = l
g.w = n
g.o = n
g.v = c
g.y = c
k.u = c
assert k.u.u.q.v.u.txt == "l"