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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: G = None
        self.r: C = None
        self.y: E = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.x: G = None
        self.p: H = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

m = A("m")
f = B("f")
b = C("b")
a = D("a")
l = E("l")
e = F("e")
c = G("c")
i = H("i")
j = I("j")
g = H("g")

m.t = f
m.q = e
m.r = e
m.p = c
m.s = g
m.o = a
f.q = i
f.r = e
f.x = g
b.s = l
a.p = e
a.q = e
a.s = c
a.r = b
a.y = l
l.q = m
l.y = f
e.w = b
c.t = l
i.o = m
i.r = m
i.t = a
i.q = a
j.o = a
j.v = g
j.x = c
j.p = i
j.y = f
j.t = m
g.o = m
g.r = m
g.t = a
g.q = a
assert c.t.q.p.t.q.o.p.w.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: F = None
        self.p: G = None
        self.s: H = None
        self.o: D = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: G = None
        self.r: C = None
        self.y: E = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.x: G = None
        self.p: H = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

m = A("m")
f = B("f")
b = C("b")
a = D("a")
l = E("l")
e = F("e")
c = G("c")
i = H("i")
j = I("j")
g = H("g")

m.t = f
m.q = e
m.r = e
m.p = c
m.s = g
m.o = a
f.q = i
f.r = e
f.x = g
b.s = l
a.p = e
a.q = e
a.s = c
a.r = b
a.y = l
l.q = m
l.y = f
e.w = b
c.t = l
i.o = m
i.r = m
i.t = a
i.q = a
j.o = a
j.v = g
j.x = c
j.p = i
j.y = f
j.t = m
g.o = m
g.r = m
g.t = a
g.q = a
assert c.t.q.p.t.q.o.p.w.s.q.txt == "m"