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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: H = None
        self.p: A = None
        self.z: F = None
        self.t: H = None
        self.x: G = None
        self.w: H = None
        self.s: A = 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.t: A = None
        self.u: B = None
        self.p: H = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: H = None
        self.p: A = None
        self.z: F = None
        self.t: H = None
        self.x: G = None
        self.w: H = None
        self.s: A = 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.t: A = None
        self.u: B = None
        self.p: H = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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