class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.u: F = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: A = None
        self.t: E = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.u: C = None
        self.r: C = None
        self.t: B = None
        self.txt = txt

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

k.q = e
k.u = e
k.p = c
k.r = d
d.p = c
d.z = c
d.o = b
d.t = f
d.s = f
n.s = c
n.z = c
n.u = c
n.t = b
n.o = a
c.v = g
f.t = j
e.q = j
e.u = f
e.r = a
e.v = a
e.w = a
e.o = c
e.t = k
g.y = c
g.q = a
g.u = n
g.r = j
g.t = d
j.s = c
j.z = c
j.u = c
j.t = k
j.o = a
b.q = e
b.p = c
b.u = a
b.r = d
a.q = j
a.u = f
a.r = e
a.v = e
a.w = e
a.o = c
a.t = k
assert d.z.v.y.v.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.u: F = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: A = None
        self.t: E = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.u: C = None
        self.r: C = None
        self.t: B = None
        self.txt = txt

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

k.q = e
k.u = e
k.p = c
k.r = d
d.p = c
d.z = c
d.o = b
d.t = f
d.s = f
n.s = c
n.z = c
n.u = c
n.t = b
n.o = a
c.v = g
f.t = j
e.q = j
e.u = f
e.r = a
e.v = a
e.w = a
e.o = c
e.t = k
g.y = c
g.q = a
g.u = n
g.r = j
g.t = d
j.s = c
j.z = c
j.u = c
j.t = k
j.o = a
b.q = e
b.p = c
b.u = a
b.r = d
a.q = j
a.u = f
a.r = e
a.v = e
a.w = e
a.o = c
a.t = k
assert d.z.v.y.v.q.u.txt == "f"