class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: D = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: B = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: F = None
        self.u: C = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.v: B = None
        self.w: D = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: E = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: B = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: F = None
        self.u: C = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.v: B = None
        self.w: D = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: E = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

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