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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: E = None
        self.q: H = None
        self.o: A = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: E = None
        self.w: A = None
        self.q: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: E = None
        self.q: H = None
        self.o: A = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: E = None
        self.w: A = None
        self.q: H = None
        self.txt = txt

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

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

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