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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: E = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.o: C = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: E = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.o: C = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

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

j.q = n
j.o = i
j.w = k
j.x = h
f.p = d
i.y = f
i.r = f
i.q = d
k.u = n
d.p = h
d.q = a
d.u = a
d.o = i
d.x = k
a.p = i
a.t = k
n.q = d
n.r = d
n.s = d
n.z = f
h.p = i
h.t = k
assert j.o.q.x.u.s.x.u.r.txt == "d"