class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.o: E = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

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

j.r = c
j.t = g
j.o = e
j.p = d
j.x = a
a.s = f
f.p = g
f.y = d
f.q = l
l.x = g
e.o = f
g.x = c
k.r = g
k.t = c
k.o = d
k.p = d
k.x = a
i.r = c
i.t = g
i.o = d
i.p = e
i.x = a
c.x = g
d.o = f
assert j.t.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.o: E = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

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

j.r = c
j.t = g
j.o = e
j.p = d
j.x = a
a.s = f
f.p = g
f.y = d
f.q = l
l.x = g
e.o = f
g.x = c
k.r = g
k.t = c
k.o = d
k.p = d
k.x = a
i.r = c
i.t = g
i.o = d
i.p = e
i.x = a
c.x = g
d.o = f
assert j.t.x.x.txt == "g"