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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: E = None
        self.s: A = None
        self.u: H = None
        self.v: E = None
        self.z: B = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

b = A("b")
l = B("l")
e = C("e")
g = D("g")
i = E("i")
h = F("h")
n = G("n")
c = H("c")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: E = None
        self.s: A = None
        self.u: H = None
        self.v: E = None
        self.z: B = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

b = A("b")
l = B("l")
e = C("e")
g = D("g")
i = E("i")
h = F("h")
n = G("n")
c = H("c")

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