class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.txt = txt

a = A("a")
b = B("b")
m = C("m")
e = D("e")
l = E("l")
g = F("g")
d = E("d")
c = B("c")
n = E("n")

a.w = e
a.x = g
b.v = e
b.p = c
m.p = a
m.u = l
m.s = e
e.x = c
e.t = d
l.v = m
l.z = m
g.s = c
g.u = m
d.v = m
d.z = m
c.v = e
c.p = b
n.v = m
n.z = m
assert g.s.p.v.x.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.txt = txt

a = A("a")
b = B("b")
m = C("m")
e = D("e")
l = E("l")
g = F("g")
d = E("d")
c = B("c")
n = E("n")

a.w = e
a.x = g
b.v = e
b.p = c
m.p = a
m.u = l
m.s = e
e.x = c
e.t = d
l.v = m
l.z = m
g.s = c
g.u = m
d.v = m
d.z = m
c.v = e
c.p = b
n.v = m
n.z = m
assert g.s.p.v.x.v.x.txt == "c"