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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.p: E = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.p: E = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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