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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: B = None
        self.x: A = None
        self.z: I = None
        self.t: I = None
        self.q: E = None
        self.r: E = None
        self.w: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: F = None
        self.r: E = None
        self.o: I = None
        self.s: A = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: B = None
        self.x: A = None
        self.z: I = None
        self.t: I = None
        self.q: E = None
        self.r: E = None
        self.w: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: F = None
        self.r: E = None
        self.o: I = None
        self.s: A = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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