class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: E = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

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

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

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