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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.v: F = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.v: B = None
        self.u: G = None
        self.y: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.r: G = None
        self.z: D = None
        self.q: C = None
        self.x: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: H = None
        self.o: E = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: H = None
        self.z: B = None
        self.y: B = None
        self.t: C = None
        self.s: E = None
        self.v: H = None
        self.txt = txt

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

a = A("a")
e = B("e")
h = C("h")
m = D("m")
d = E("d")
b = F("b")
j = G("j")
n = H("n")
c = F("c")

a.p = n
a.z = m
a.r = h
e.x = n
h.x = d
h.q = d
h.u = c
h.v = c
h.y = c
m.r = h
m.z = h
m.y = h
m.v = e
m.u = j
m.w = a
d.t = j
d.r = j
d.x = j
d.v = j
d.u = c
d.z = m
d.q = h
b.z = h
b.y = n
b.o = d
b.u = m
b.r = e
j.q = c
j.o = n
j.v = n
j.z = e
j.y = e
j.t = h
j.s = d
n.v = j
n.s = h
c.z = h
c.y = n
c.o = d
c.u = m
c.r = e
assert d.q.x.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: D = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.v: F = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.v: B = None
        self.u: G = None
        self.y: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.r: G = None
        self.z: D = None
        self.q: C = None
        self.x: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: H = None
        self.o: E = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: H = None
        self.z: B = None
        self.y: B = None
        self.t: C = None
        self.s: E = None
        self.v: H = None
        self.txt = txt

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

a = A("a")
e = B("e")
h = C("h")
m = D("m")
d = E("d")
b = F("b")
j = G("j")
n = H("n")
c = F("c")

a.p = n
a.z = m
a.r = h
e.x = n
h.x = d
h.q = d
h.u = c
h.v = c
h.y = c
m.r = h
m.z = h
m.y = h
m.v = e
m.u = j
m.w = a
d.t = j
d.r = j
d.x = j
d.v = j
d.u = c
d.z = m
d.q = h
b.z = h
b.y = n
b.o = d
b.u = m
b.r = e
j.q = c
j.o = n
j.v = n
j.z = e
j.y = e
j.t = h
j.s = d
n.v = j
n.s = h
c.z = h
c.y = n
c.o = d
c.u = m
c.r = e
assert d.q.x.q.v.txt == "c"