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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.y: G = None
        self.u: A = None
        self.z: A = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: C = None
        self.r: E = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: D = None
        self.x: G = None
        self.u: A = None
        self.o: B = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.y: G = None
        self.u: A = None
        self.z: A = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: C = None
        self.r: E = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: D = None
        self.x: G = None
        self.u: A = None
        self.o: B = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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