class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.q: G = None
        self.v: C = None
        self.s: F = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.v: A = None
        self.w: E = None
        self.p: F = None
        self.r: F = None
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: E = None
        self.q: A = None
        self.w: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.v: A = None
        self.w: E = None
        self.p: F = None
        self.r: F = None
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: E = None
        self.q: A = None
        self.w: A = None
        self.r: E = None
        self.txt = txt

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

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