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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: A = None
        self.r: B = None
        self.txt = txt

j = A("j")
m = B("m")
c = C("c")
k = D("k")
f = E("f")
l = D("l")
g = B("g")

j.o = c
j.y = m
j.z = f
m.w = k
m.x = k
m.y = l
m.s = g
c.p = f
k.y = c
k.p = c
k.r = m
k.s = g
k.t = g
f.w = c
f.x = j
f.r = m
l.y = c
l.p = c
l.r = g
l.t = g
l.s = m
g.w = k
g.y = l
g.x = l
g.s = m
assert k.y.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: B = None
        self.z: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: A = None
        self.r: B = None
        self.txt = txt

j = A("j")
m = B("m")
c = C("c")
k = D("k")
f = E("f")
l = D("l")
g = B("g")

j.o = c
j.y = m
j.z = f
m.w = k
m.x = k
m.y = l
m.s = g
c.p = f
k.y = c
k.p = c
k.r = m
k.s = g
k.t = g
f.w = c
f.x = j
f.r = m
l.y = c
l.p = c
l.r = g
l.t = g
l.s = m
g.w = k
g.y = l
g.x = l
g.s = m
assert k.y.p.x.txt == "j"