class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: B = None
        self.p: E = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.q: A = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

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

g.r = l
g.x = d
n.r = f
f.t = d
f.w = j
f.p = k
f.o = k
h.x = k
h.v = f
h.p = l
h.s = l
h.r = g
h.o = g
h.t = n
k.u = n
k.t = g
k.p = j
l.w = g
l.q = g
l.t = k
l.u = k
l.s = n
d.o = k
d.q = n
d.w = l
j.r = f
assert l.u.p.r.t.o.u.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: B = None
        self.p: E = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.q: A = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

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

g.r = l
g.x = d
n.r = f
f.t = d
f.w = j
f.p = k
f.o = k
h.x = k
h.v = f
h.p = l
h.s = l
h.r = g
h.o = g
h.t = n
k.u = n
k.t = g
k.p = j
l.w = g
l.q = g
l.t = k
l.u = k
l.s = n
d.o = k
d.q = n
d.w = l
j.r = f
assert l.u.p.r.t.o.u.r.w.txt == "j"