class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: B = None
        self.s: F = None
        self.z: B = None
        self.r: F = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: F = None
        self.v: E = None
        self.q: D = None
        self.w: E = None
        self.o: C = None
        self.p: B = None
        self.txt = txt

l = A("l")
h = B("h")
i = C("i")
b = D("b")
g = E("g")
j = F("j")
c = G("c")
n = A("n")
d = G("d")
e = F("e")

l.s = h
h.q = c
i.z = c
i.y = g
b.y = h
b.s = d
g.r = c
j.p = b
j.w = b
j.o = h
j.z = h
j.s = e
j.r = e
c.y = i
c.o = i
c.u = e
c.v = g
c.w = g
c.q = b
c.p = h
n.s = h
d.y = i
d.o = i
d.u = e
d.v = g
d.w = g
d.q = b
d.p = h
e.p = b
e.w = b
e.o = h
e.z = h
e.s = j
e.r = j
assert d.q.y.q.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: B = None
        self.s: F = None
        self.z: B = None
        self.r: F = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: F = None
        self.v: E = None
        self.q: D = None
        self.w: E = None
        self.o: C = None
        self.p: B = None
        self.txt = txt

l = A("l")
h = B("h")
i = C("i")
b = D("b")
g = E("g")
j = F("j")
c = G("c")
n = A("n")
d = G("d")
e = F("e")

l.s = h
h.q = c
i.z = c
i.y = g
b.y = h
b.s = d
g.r = c
j.p = b
j.w = b
j.o = h
j.z = h
j.s = e
j.r = e
c.y = i
c.o = i
c.u = e
c.v = g
c.w = g
c.q = b
c.p = h
n.s = h
d.y = i
d.o = i
d.u = e
d.v = g
d.w = g
d.q = b
d.p = h
e.p = b
e.w = b
e.o = h
e.z = h
e.s = j
e.r = j
assert d.q.y.q.o.y.txt == "g"