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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.z: F = None
        self.q: E = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: A = None
        self.txt = txt

c = A("c")
n = B("n")
m = C("m")
e = D("e")
l = E("l")
i = F("i")
f = G("f")
b = H("b")
d = H("d")

c.v = b
c.x = f
c.w = i
n.x = l
n.t = c
m.p = l
m.v = l
m.s = i
e.t = c
e.u = c
e.s = f
e.z = i
e.q = l
l.v = b
l.y = n
i.q = d
i.p = n
i.s = n
f.s = l
f.q = b
b.r = i
b.z = c
d.r = i
d.z = c
assert m.p.v.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: G = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.z: F = None
        self.q: E = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: A = None
        self.txt = txt

c = A("c")
n = B("n")
m = C("m")
e = D("e")
l = E("l")
i = F("i")
f = G("f")
b = H("b")
d = H("d")

c.v = b
c.x = f
c.w = i
n.x = l
n.t = c
m.p = l
m.v = l
m.s = i
e.t = c
e.u = c
e.s = f
e.z = i
e.q = l
l.v = b
l.y = n
i.q = d
i.p = n
i.s = n
f.s = l
f.q = b
b.r = i
b.z = c
d.r = i
d.z = c
assert m.p.v.r.p.txt == "n"