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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

d.u = c
d.o = c
k.t = n
k.z = d
k.r = i
k.o = g
m.p = k
m.v = k
m.t = n
i.y = j
i.r = e
i.w = n
c.u = e
c.r = j
j.u = k
n.p = k
n.v = k
n.t = m
l.y = j
l.r = e
l.w = m
g.u = e
g.o = e
e.u = c
e.r = j
assert g.u.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

d.u = c
d.o = c
k.t = n
k.z = d
k.r = i
k.o = g
m.p = k
m.v = k
m.t = n
i.y = j
i.r = e
i.w = n
c.u = e
c.r = j
j.u = k
n.p = k
n.v = k
n.t = m
l.y = j
l.r = e
l.w = m
g.u = e
g.o = e
e.u = c
e.r = j
assert g.u.u.r.txt == "j"