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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: C = None
        self.w: C = None
        self.r: B = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.q: F = None
        self.u: F = None
        self.z: B = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

l = A("l")
d = B("d")
a = C("a")
h = D("h")
k = E("k")
f = F("f")
c = G("c")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: C = None
        self.w: C = None
        self.r: B = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.q: F = None
        self.u: F = None
        self.z: B = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

l = A("l")
d = B("d")
a = C("a")
h = D("h")
k = E("k")
f = F("f")
c = G("c")

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