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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.z: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.v: C = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

g = A("g")
e = B("e")
i = C("i")
j = D("j")
k = E("k")
c = D("c")

g.p = i
g.u = j
e.t = c
e.u = k
i.v = c
i.s = j
i.x = j
i.w = k
j.r = c
j.w = g
j.z = g
j.p = e
k.t = c
k.o = c
k.v = i
k.w = i
k.z = g
c.r = j
c.w = g
c.z = g
c.p = e
assert k.o.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.z: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.v: C = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

g = A("g")
e = B("e")
i = C("i")
j = D("j")
k = E("k")
c = D("c")

g.p = i
g.u = j
e.t = c
e.u = k
i.v = c
i.s = j
i.x = j
i.w = k
j.r = c
j.w = g
j.z = g
j.p = e
k.t = c
k.o = c
k.v = i
k.w = i
k.z = g
c.r = j
c.w = g
c.z = g
c.p = e
assert k.o.p.t.txt == "c"