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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.txt = txt

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

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

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