class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.w: F = None
        self.v: B = None
        self.o: F = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: E = None
        self.u: A = None
        self.w: D = None
        self.v: E = None
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: C = None
        self.x: A = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

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

j = A("j")
c = B("c")
f = C("f")
h = D("h")
l = E("l")
k = F("k")
b = G("b")
i = H("i")

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: E = None
        self.u: A = None
        self.w: D = None
        self.v: E = None
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: C = None
        self.x: A = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

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

j = A("j")
c = B("c")
f = C("f")
h = D("h")
l = E("l")
k = F("k")
b = G("b")
i = H("i")

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