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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: G = None
        self.r: D = None
        self.u: D = None
        self.s: E = None
        self.x: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.r: A = None
        self.t: E = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

f = A("f")
m = B("m")
l = C("l")
h = D("h")
a = E("a")
i = F("i")
g = G("g")
d = C("d")

f.q = m
m.z = a
m.x = i
m.u = l
m.s = f
m.o = f
m.t = g
m.q = h
l.w = f
l.p = g
l.x = g
l.r = h
l.u = h
l.s = a
h.x = a
h.w = a
a.y = l
i.s = f
i.p = f
i.o = d
i.x = a
i.v = h
i.u = g
g.p = m
g.x = m
g.r = f
g.t = a
g.u = a
g.z = h
d.w = f
d.p = g
d.x = g
d.r = h
d.u = h
d.s = a
assert l.x.r.q.s.q.x.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: G = None
        self.r: D = None
        self.u: D = None
        self.s: E = None
        self.x: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.r: A = None
        self.t: E = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

f = A("f")
m = B("m")
l = C("l")
h = D("h")
a = E("a")
i = F("i")
g = G("g")
d = C("d")

f.q = m
m.z = a
m.x = i
m.u = l
m.s = f
m.o = f
m.t = g
m.q = h
l.w = f
l.p = g
l.x = g
l.r = h
l.u = h
l.s = a
h.x = a
h.w = a
a.y = l
i.s = f
i.p = f
i.o = d
i.x = a
i.v = h
i.u = g
g.p = m
g.x = m
g.r = f
g.t = a
g.u = a
g.z = h
d.w = f
d.p = g
d.x = g
d.r = h
d.u = h
d.s = a
assert l.x.r.q.s.q.x.x.y.txt == "l"