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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

j = A("j")
k = B("k")
f = C("f")
b = D("b")
h = E("h")
g = F("g")
d = G("d")
m = H("m")
a = E("a")
c = A("c")

j.q = d
j.y = f
j.r = f
j.t = c
j.p = k
k.r = g
k.q = f
f.o = m
f.r = g
b.q = m
b.w = f
b.y = j
b.v = g
b.p = g
b.u = c
h.u = m
g.r = h
g.t = b
g.z = k
g.w = m
g.o = c
d.o = c
d.t = j
m.r = k
a.u = m
c.q = d
c.y = f
c.r = f
c.t = j
c.p = k
assert h.u.r.q.o.r.q.o.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: C = None
        self.r: C = None
        self.t: A = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

j = A("j")
k = B("k")
f = C("f")
b = D("b")
h = E("h")
g = F("g")
d = G("d")
m = H("m")
a = E("a")
c = A("c")

j.q = d
j.y = f
j.r = f
j.t = c
j.p = k
k.r = g
k.q = f
f.o = m
f.r = g
b.q = m
b.w = f
b.y = j
b.v = g
b.p = g
b.u = c
h.u = m
g.r = h
g.t = b
g.z = k
g.w = m
g.o = c
d.o = c
d.t = j
m.r = k
a.u = m
c.q = d
c.y = f
c.r = f
c.t = j
c.p = k
assert h.u.r.q.o.r.q.o.r.r.txt == "g"