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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.q: G = None
        self.p: D = None
        self.y: C = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.v: F = None
        self.p: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: F = None
        self.q: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.o: E = None
        self.v: A = None
        self.p: G = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: C = None
        self.w: A = None
        self.y: B = None
        self.v: E = None
        self.txt = txt

d = A("d")
n = B("n")
l = C("l")
h = D("h")
b = E("b")
m = F("m")
f = G("f")
j = C("j")

d.p = n
d.w = b
n.x = f
n.q = f
n.w = m
n.u = m
n.p = h
n.t = h
n.y = j
l.t = h
h.y = m
h.v = m
h.p = m
h.o = b
h.z = j
b.r = f
b.w = m
b.v = m
b.q = h
m.u = h
m.s = h
m.o = b
m.v = d
m.r = d
m.p = f
f.q = h
f.o = j
f.w = d
f.y = n
f.v = b
j.t = h
assert d.w.w.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.q: G = None
        self.p: D = None
        self.y: C = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.v: F = None
        self.p: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: F = None
        self.q: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.o: E = None
        self.v: A = None
        self.p: G = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: C = None
        self.w: A = None
        self.y: B = None
        self.v: E = None
        self.txt = txt

d = A("d")
n = B("n")
l = C("l")
h = D("h")
b = E("b")
m = F("m")
f = G("f")
j = C("j")

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