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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: G = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: G = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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