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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: F = None
        self.y: F = None
        self.u: C = None
        self.v: G = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.z: E = None
        self.r: E = None
        self.u: F = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: F = None
        self.y: F = None
        self.u: C = None
        self.v: G = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.z: E = None
        self.r: E = None
        self.u: F = None
        self.q: H = None
        self.txt = txt

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

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

d.o = m
g.r = i
g.p = h
g.o = j
m.s = d
m.w = c
m.q = i
m.x = g
h.o = i
h.x = d
a.t = h
a.p = i
a.y = i
a.u = m
a.v = c
a.w = g
i.o = g
i.u = m
i.z = h
c.o = h
c.w = h
c.z = a
c.r = a
c.u = i
c.q = j
j.r = h
assert c.r.v.z.u.s.txt == "d"