class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.o: C = None
        self.v: C = None
        self.q: C = None
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.v: F = None
        self.txt = txt

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

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