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

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

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

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

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

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

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

n.z = i
n.v = l
n.y = h
n.r = g
n.w = g
e.u = j
j.o = l
j.u = e
i.z = m
i.x = n
i.o = g
g.z = i
m.y = e
h.u = j
b.z = i
b.v = l
b.y = e
b.r = g
b.w = g
l.o = j
l.u = h
assert g.z.x.v.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: C = None
        self.y: B = None
        self.r: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

n.z = i
n.v = l
n.y = h
n.r = g
n.w = g
e.u = j
j.o = l
j.u = e
i.z = m
i.x = n
i.o = g
g.z = i
m.y = e
h.u = j
b.z = i
b.v = l
b.y = e
b.r = g
b.w = g
l.o = j
l.u = h
assert g.z.x.v.u.u.txt == "j"