class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.v: A = 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.t: C = None
        self.txt = txt

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

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

c = A("c")
f = B("f")
b = C("b")
a = D("a")
i = E("i")
h = D("h")
g = A("g")
n = C("n")
m = E("m")
d = E("d")

c.w = f
c.x = f
c.v = g
f.r = c
b.t = n
a.z = f
a.t = c
a.s = g
a.r = b
i.p = c
i.t = f
i.x = h
h.z = f
h.t = c
h.s = c
h.r = n
g.w = f
g.x = f
g.v = c
n.t = b
m.p = c
m.t = f
m.x = a
d.p = c
d.t = f
d.x = a
assert a.t.v.v.w.r.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.v: A = 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.t: C = None
        self.txt = txt

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

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

c = A("c")
f = B("f")
b = C("b")
a = D("a")
i = E("i")
h = D("h")
g = A("g")
n = C("n")
m = E("m")
d = E("d")

c.w = f
c.x = f
c.v = g
f.r = c
b.t = n
a.z = f
a.t = c
a.s = g
a.r = b
i.p = c
i.t = f
i.x = h
h.z = f
h.t = c
h.s = c
h.r = n
g.w = f
g.x = f
g.v = c
n.t = b
m.p = c
m.t = f
m.x = a
d.p = c
d.t = f
d.x = a
assert a.t.v.v.w.r.v.v.txt == "c"