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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: C = None
        self.txt = txt

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

k = A("k")
n = B("n")
m = C("m")
i = D("i")
d = E("d")
h = F("h")
g = G("g")
j = B("j")
c = A("c")
b = B("b")

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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: C = None
        self.txt = txt

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

k = A("k")
n = B("n")
m = C("m")
i = D("i")
d = E("d")
h = F("h")
g = G("g")
j = B("j")
c = A("c")
b = B("b")

k.r = m
k.q = d
k.u = d
k.p = d
k.s = g
n.o = b
n.v = h
m.y = g
m.r = k
i.x = d
i.w = j
d.p = k
d.q = j
h.t = m
h.s = m
g.r = c
j.o = n
j.v = h
c.r = m
c.q = d
c.u = d
c.p = d
c.s = g
b.o = j
b.v = h
assert j.v.s.r.r.y.r.r.r.u.p.txt == "k"