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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: F = None
        self.v: G = None
        self.o: E = None
        self.s: B = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: F = None
        self.v: G = None
        self.o: E = None
        self.s: B = None
        self.q: F = None
        self.txt = txt

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

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