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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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