class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.p: H = None
        self.x: H = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.p: H = None
        self.x: H = None
        self.u: D = None
        self.txt = txt

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

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

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