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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.q: D = None
        self.z: G = None
        self.o: D = None
        self.v: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.q: D = None
        self.z: G = None
        self.o: D = None
        self.v: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

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

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