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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: B = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.y: D = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

f = A("f")
i = B("i")
e = C("e")
h = D("h")
g = E("g")
a = F("a")
c = B("c")
j = A("j")
n = E("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: B = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.y: D = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

f = A("f")
i = B("i")
e = C("e")
h = D("h")
g = E("g")
a = F("a")
c = B("c")
j = A("j")
n = E("n")

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