class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.v: B = None
        self.p: D = None
        self.r: E = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

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

g = A("g")
b = B("b")
j = C("j")
a = D("a")
e = E("e")
l = F("l")
d = G("d")
k = D("k")
h = A("h")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

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

g = A("g")
b = B("b")
j = C("j")
a = D("a")
e = E("e")
l = F("l")
d = G("d")
k = D("k")
h = A("h")

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