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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: F = None
        self.t: B = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: F = None
        self.t: B = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

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

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

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

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