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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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