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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.y: E = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: B = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.y: E = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: B = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

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

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