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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: A = None
        self.r: D = None
        self.y: C = None
        self.txt = txt

d = A("d")
l = B("l")
a = C("a")
c = D("c")
j = C("j")
b = D("b")
e = B("e")
i = A("i")
m = D("m")
g = B("g")

d.u = l
d.y = i
d.r = e
l.r = d
l.v = e
l.q = g
a.y = b
a.s = i
a.r = d
a.o = m
c.s = b
c.r = b
c.p = i
c.y = a
j.y = b
j.o = b
j.s = d
j.r = i
b.s = m
b.r = m
b.p = d
b.y = a
e.r = i
e.v = l
e.q = l
i.u = l
i.r = l
i.y = d
m.s = c
m.p = d
m.r = b
m.y = j
g.r = d
g.v = e
g.q = l
assert j.y.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: A = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: A = None
        self.r: D = None
        self.y: C = None
        self.txt = txt

d = A("d")
l = B("l")
a = C("a")
c = D("c")
j = C("j")
b = D("b")
e = B("e")
i = A("i")
m = D("m")
g = B("g")

d.u = l
d.y = i
d.r = e
l.r = d
l.v = e
l.q = g
a.y = b
a.s = i
a.r = d
a.o = m
c.s = b
c.r = b
c.p = i
c.y = a
j.y = b
j.o = b
j.s = d
j.r = i
b.s = m
b.r = m
b.p = d
b.y = a
e.r = i
e.v = l
e.q = l
i.u = l
i.r = l
i.y = d
m.s = c
m.p = d
m.r = b
m.y = j
g.r = d
g.v = e
g.q = l
assert j.y.y.s.txt == "i"