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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: H = None
        self.o: D = None
        self.x: D = None
        self.z: D = None
        self.t: E = None
        self.u: A = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: G = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: H = None
        self.o: D = None
        self.x: D = None
        self.z: D = None
        self.t: E = None
        self.u: A = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: G = None
        self.r: B = None
        self.txt = txt

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

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