class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: B = None
        self.r: E = None
        self.x: A = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.x: F = None
        self.p: C = None
        self.r: G = None
        self.v: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: B = None
        self.r: E = None
        self.x: A = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.x: F = None
        self.p: C = None
        self.r: G = None
        self.v: I = None
        self.txt = txt

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

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

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