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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.z: F = None
        self.r: C = None
        self.w: C = None
        self.q: D = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: E = None
        self.t: A = None
        self.w: C = None
        self.r: F = None
        self.q: A = None
        self.z: H = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.z: F = None
        self.r: C = None
        self.w: C = None
        self.q: D = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: E = None
        self.t: A = None
        self.w: C = None
        self.r: F = None
        self.q: A = None
        self.z: H = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: H = None
        self.txt = txt

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

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

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