class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: F = None
        self.r: A = None
        self.p: E = None
        self.u: C = None
        self.x: C = None
        self.q: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.u: F = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: C = None
        self.q: A = None
        self.r: G = None
        self.v: A = None
        self.p: A = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: B = None
        self.s: C = None
        self.w: H = None
        self.t: H = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: A = None
        self.y: F = None
        self.u: B = None
        self.q: B = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: B = None
        self.y: D = None
        self.s: G = None
        self.r: D = None
        self.z: E = None
        self.p: H = None
        self.txt = txt

b = A("b")
j = B("j")
a = C("a")
m = D("m")
g = E("g")
i = F("i")
n = G("n")
c = H("c")
k = H("k")
l = F("l")

b.q = a
j.v = b
j.r = b
j.q = b
j.z = l
j.p = g
j.u = a
j.x = a
j.w = a
a.y = g
a.w = b
a.o = b
a.u = i
a.t = m
m.u = n
m.r = n
m.t = a
m.q = b
m.v = b
m.p = b
m.y = i
g.w = i
i.y = a
i.s = a
i.r = j
i.w = c
i.t = k
i.p = m
n.r = k
n.o = b
n.y = l
n.u = j
n.q = j
n.x = a
n.v = m
c.q = i
c.x = j
c.y = m
c.r = m
c.s = n
c.z = g
c.p = k
k.q = i
k.x = j
k.y = m
k.r = m
k.s = n
k.z = g
k.p = c
l.y = a
l.s = a
l.r = j
l.w = c
l.t = c
l.p = m
assert g.w.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: F = None
        self.r: A = None
        self.p: E = None
        self.u: C = None
        self.x: C = None
        self.q: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.u: F = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: C = None
        self.q: A = None
        self.r: G = None
        self.v: A = None
        self.p: A = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: B = None
        self.s: C = None
        self.w: H = None
        self.t: H = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: A = None
        self.y: F = None
        self.u: B = None
        self.q: B = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: B = None
        self.y: D = None
        self.s: G = None
        self.r: D = None
        self.z: E = None
        self.p: H = None
        self.txt = txt

b = A("b")
j = B("j")
a = C("a")
m = D("m")
g = E("g")
i = F("i")
n = G("n")
c = H("c")
k = H("k")
l = F("l")

b.q = a
j.v = b
j.r = b
j.q = b
j.z = l
j.p = g
j.u = a
j.x = a
j.w = a
a.y = g
a.w = b
a.o = b
a.u = i
a.t = m
m.u = n
m.r = n
m.t = a
m.q = b
m.v = b
m.p = b
m.y = i
g.w = i
i.y = a
i.s = a
i.r = j
i.w = c
i.t = k
i.p = m
n.r = k
n.o = b
n.y = l
n.u = j
n.q = j
n.x = a
n.v = m
c.q = i
c.x = j
c.y = m
c.r = m
c.s = n
c.z = g
c.p = k
k.q = i
k.x = j
k.y = m
k.r = m
k.s = n
k.z = g
k.p = c
l.y = a
l.s = a
l.r = j
l.w = c
l.t = c
l.p = m
assert g.w.t.p.txt == "c"