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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.x: B = None
        self.y: G = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.x: B = None
        self.y: G = None
        self.r: A = None
        self.txt = txt

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

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