class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

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

b = A("b")
g = B("g")
h = C("h")
k = D("k")
a = E("a")
e = B("e")
n = C("n")
j = A("j")

b.u = h
b.r = j
b.t = j
g.o = h
g.v = b
g.y = a
g.q = k
h.y = k
h.t = k
h.o = a
h.s = n
k.x = g
a.s = n
e.o = h
e.v = b
e.y = a
e.q = k
n.y = k
n.t = k
n.o = a
n.s = h
j.u = n
j.r = b
j.t = b
assert j.t.r.u.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

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

b = A("b")
g = B("g")
h = C("h")
k = D("k")
a = E("a")
e = B("e")
n = C("n")
j = A("j")

b.u = h
b.r = j
b.t = j
g.o = h
g.v = b
g.y = a
g.q = k
h.y = k
h.t = k
h.o = a
h.s = n
k.x = g
a.s = n
e.o = h
e.v = b
e.y = a
e.q = k
n.y = k
n.t = k
n.o = a
n.s = h
j.u = n
j.r = b
j.t = b
assert j.t.r.u.t.x.txt == "g"