class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: G = None
        self.q: C = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: E = None
        self.u: A = None
        self.o: A = None
        self.q: A = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: E = None
        self.u: A = None
        self.o: A = None
        self.q: A = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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