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

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

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

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

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

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

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

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

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

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

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