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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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