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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: I = None
        self.v: D = None
        self.z: E = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: H = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: I = None
        self.v: D = None
        self.z: E = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: H = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

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

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

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