class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.s: D = None
        self.t: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: G = None
        self.t: C = None
        self.s: A = None
        self.w: G = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: F = None
        self.y: H = None
        self.w: D = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.x: G = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: G = None
        self.t: C = None
        self.s: A = None
        self.w: G = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: F = None
        self.y: H = None
        self.w: D = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.x: G = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

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

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

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

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