class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: B = None
        self.w: H = None
        self.v: C = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: H = None
        self.q: F = None
        self.s: A = None
        self.y: H = None
        self.r: D = None
        self.x: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: H = None
        self.q: F = None
        self.s: A = None
        self.y: H = None
        self.r: D = None
        self.x: D = None
        self.txt = txt

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

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

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