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

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

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

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

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

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

m = A("m")
h = B("h")
k = C("k")
e = D("e")
n = E("n")
g = F("g")
f = F("f")
j = E("j")

m.u = f
h.z = k
h.y = k
h.w = g
k.w = e
k.v = e
k.o = m
k.t = n
e.r = g
n.y = e
n.p = k
n.t = m
n.w = m
n.x = g
n.v = h
g.r = n
g.z = n
g.o = n
f.r = j
f.z = j
f.o = n
j.y = e
j.p = k
j.t = m
j.w = m
j.x = g
j.v = h
assert e.r.z.w.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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

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

m = A("m")
h = B("h")
k = C("k")
e = D("e")
n = E("n")
g = F("g")
f = F("f")
j = E("j")

m.u = f
h.z = k
h.y = k
h.w = g
k.w = e
k.v = e
k.o = m
k.t = n
e.r = g
n.y = e
n.p = k
n.t = m
n.w = m
n.x = g
n.v = h
g.r = n
g.z = n
g.o = n
f.r = j
f.z = j
f.o = n
j.y = e
j.p = k
j.t = m
j.w = m
j.x = g
j.v = h
assert e.r.z.w.u.o.txt == "n"