class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.y: C = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

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

i.v = e
b.r = a
k.x = n
k.y = n
k.z = n
k.p = g
k.t = d
l.x = n
e.w = n
a.v = e
j.r = a
d.r = i
n.x = k
n.y = k
n.z = k
n.p = b
n.t = j
g.r = a
assert b.r.v.w.z.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.y: C = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

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

i.v = e
b.r = a
k.x = n
k.y = n
k.z = n
k.p = g
k.t = d
l.x = n
e.w = n
a.v = e
j.r = a
d.r = i
n.x = k
n.y = k
n.z = k
n.p = b
n.t = j
g.r = a
assert b.r.v.w.z.p.r.txt == "a"