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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: I = None
        self.s: E = None
        self.t: E = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: I = None
        self.s: E = None
        self.t: E = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

n.v = c
n.u = m
n.t = e
f.o = m
f.w = n
f.p = h
k.z = e
k.o = c
k.v = c
k.s = c
j.u = e
j.q = e
j.x = g
j.s = c
j.t = c
c.u = h
h.v = j
h.q = j
h.s = e
m.t = k
e.w = k
e.r = f
g.q = h
assert h.q.u.w.s.u.txt == "h"