class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.v: G = None
        self.u: C = None
        self.t: I = None
        self.z: E = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.v: I = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: G = None
        self.s: F = None
        self.x: D = None
        self.q: B = None
        self.t: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.v: I = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: G = None
        self.s: F = None
        self.x: D = None
        self.q: B = None
        self.t: H = None
        self.txt = txt

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

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