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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: F = None
        self.z: B = None
        self.x: D = None
        self.o: C = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.y: E = None
        self.o: E = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: F = None
        self.z: B = None
        self.x: D = None
        self.o: C = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.y: E = None
        self.o: E = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

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

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