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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.t: E = None
        self.txt = txt

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

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

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

g.x = i
g.y = e
j.y = e
j.r = e
j.u = m
e.v = a
e.s = j
e.t = i
k.t = f
k.q = f
k.r = a
k.z = i
m.v = a
m.s = k
m.p = k
n.x = a
n.y = e
b.t = f
b.q = f
b.r = m
b.z = i
a.v = i
a.s = b
a.p = k
i.v = m
i.s = b
i.p = k
f.y = e
f.r = e
f.u = m
assert a.v.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.t: E = None
        self.txt = txt

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

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

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

g.x = i
g.y = e
j.y = e
j.r = e
j.u = m
e.v = a
e.s = j
e.t = i
k.t = f
k.q = f
k.r = a
k.z = i
m.v = a
m.s = k
m.p = k
n.x = a
n.y = e
b.t = f
b.q = f
b.r = m
b.z = i
a.v = i
a.s = b
a.p = k
i.v = m
i.s = b
i.p = k
f.y = e
f.r = e
f.u = m
assert a.v.v.p.txt == "k"