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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.x: B = None
        self.u: D = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.x: B = None
        self.u: D = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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