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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.p: G = None
        self.z: G = None
        self.y: G = None
        self.o: G = None
        self.x: E = None
        self.u: G = None
        self.w: J = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.p: G = None
        self.z: G = None
        self.y: G = None
        self.o: G = None
        self.x: E = None
        self.u: G = None
        self.w: J = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.u: F = None
        self.txt = txt

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

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