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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.u: A = None
        self.txt = txt

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

g = A("g")
c = B("c")
j = C("j")
l = D("l")
b = E("b")
a = E("a")
k = C("k")
d = A("d")
n = D("n")
f = E("f")

g.y = l
g.t = d
c.z = k
c.o = k
c.x = a
c.u = j
j.o = g
l.w = c
l.s = n
l.u = d
b.x = f
a.x = f
k.o = d
d.y = n
d.t = g
n.w = c
n.s = l
n.u = g
f.x = a
assert c.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.u: A = None
        self.txt = txt

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

g = A("g")
c = B("c")
j = C("j")
l = D("l")
b = E("b")
a = E("a")
k = C("k")
d = A("d")
n = D("n")
f = E("f")

g.y = l
g.t = d
c.z = k
c.o = k
c.x = a
c.u = j
j.o = g
l.w = c
l.s = n
l.u = d
b.x = f
a.x = f
k.o = d
d.y = n
d.t = g
n.w = c
n.s = l
n.u = g
f.x = a
assert c.x.x.x.txt == "a"