class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: E = None
        self.v: D = None
        self.z: A = None
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: C = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

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

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

j = A("j")
c = B("c")
h = C("h")
g = D("g")
e = E("e")
f = B("f")
b = E("b")
n = A("n")
k = D("k")
i = B("i")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: C = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

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

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

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

j = A("j")
c = B("c")
h = C("h")
g = D("g")
e = E("e")
f = B("f")
b = E("b")
n = A("n")
k = D("k")
i = B("i")

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