class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: F = None
        self.w: C = None
        self.r: H = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: H = None
        self.o: G = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.w: H = None
        self.q: E = None
        self.s: E = None
        self.x: A = None
        self.r: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: H = None
        self.t: B = None
        self.s: F = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.v: E = None
        self.x: F = None
        self.r: H = None
        self.txt = txt

h = A("h")
l = B("l")
n = C("n")
m = D("m")
c = E("c")
j = F("j")
b = G("b")
f = H("f")
e = H("e")

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: H = None
        self.o: G = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.w: H = None
        self.q: E = None
        self.s: E = None
        self.x: A = None
        self.r: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: H = None
        self.t: B = None
        self.s: F = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.v: E = None
        self.x: F = None
        self.r: H = None
        self.txt = txt

h = A("h")
l = B("l")
n = C("n")
m = D("m")
c = E("c")
j = F("j")
b = G("b")
f = H("f")
e = H("e")

h.q = j
h.x = j
h.w = n
h.r = f
h.s = f
l.y = c
l.z = n
n.p = l
n.r = l
n.t = e
n.x = e
n.o = b
m.t = n
m.r = n
m.p = j
m.w = e
m.q = c
m.s = c
m.x = h
c.w = b
c.y = b
c.r = m
c.t = m
c.s = n
c.q = n
c.v = l
c.p = h
j.r = n
j.y = b
b.p = f
b.o = e
b.t = l
b.s = j
b.r = n
b.u = c
f.u = e
f.r = e
f.p = h
f.v = c
f.x = j
e.u = f
e.r = f
e.p = h
e.v = c
e.x = j
assert j.r.p.y.r.q.txt == "c"