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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: A = None
        self.u: A = None
        self.r: C = None
        self.txt = txt

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

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

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

k = A("k")
g = B("g")
e = C("e")
b = D("b")
j = E("j")
i = F("i")
l = G("l")
m = H("m")
f = H("f")
d = A("d")

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: A = None
        self.u: A = None
        self.r: C = None
        self.txt = txt

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

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

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

k = A("k")
g = B("g")
e = C("e")
b = D("b")
j = E("j")
i = F("i")
l = G("l")
m = H("m")
f = H("f")
d = A("d")

k.q = d
g.w = d
g.v = f
g.y = e
g.o = i
g.u = b
g.z = j
g.t = l
e.r = j
e.x = j
e.y = d
e.v = f
b.u = i
b.x = l
b.w = l
j.p = k
j.t = k
j.u = d
j.r = e
i.t = g
i.r = j
i.s = f
i.z = b
i.o = b
l.w = m
l.y = b
l.p = i
l.o = i
l.r = k
l.q = d
l.s = e
l.t = f
m.q = g
f.q = g
d.q = k
assert b.u.s.q.u.u.s.q.txt == "g"