class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.y: C = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: G = None
        self.s: G = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

a = A("a")
m = B("m")
c = C("c")
n = D("n")
l = E("l")
i = F("i")
b = G("b")
k = H("k")

a.r = c
a.y = c
a.q = i
a.t = k
m.u = b
c.u = a
c.r = k
c.w = m
n.v = k
l.t = k
l.q = c
l.u = i
l.v = i
l.r = n
l.p = n
l.w = m
i.t = n
i.x = n
i.w = c
i.p = a
b.t = l
b.w = n
b.q = i
k.u = c
k.r = b
k.s = b
k.p = l
k.z = i
assert k.u.u.y.u.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.y: C = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: G = None
        self.s: G = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

a = A("a")
m = B("m")
c = C("c")
n = D("n")
l = E("l")
i = F("i")
b = G("b")
k = H("k")

a.r = c
a.y = c
a.q = i
a.t = k
m.u = b
c.u = a
c.r = k
c.w = m
n.v = k
l.t = k
l.q = c
l.u = i
l.v = i
l.r = n
l.p = n
l.w = m
i.t = n
i.x = n
i.w = c
i.p = a
b.t = l
b.w = n
b.q = i
k.u = c
k.r = b
k.s = b
k.p = l
k.z = i
assert k.u.u.y.u.t.r.txt == "b"