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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: D = None
        self.q: E = None
        self.x: E = None
        self.u: B = None
        self.r: G = None
        self.v: D = None
        self.o: A = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: I = None
        self.r: B = None
        self.x: F = None
        self.t: B = None
        self.o: B = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: D = None
        self.q: E = None
        self.x: E = None
        self.u: B = None
        self.r: G = None
        self.v: D = None
        self.o: A = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: I = None
        self.r: B = None
        self.x: F = None
        self.t: B = None
        self.o: B = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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