class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.q: E = None
        self.y: H = None
        self.t: E = None
        self.s: C = None
        self.z: I = None
        self.v: H = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: I = None
        self.z: A = None
        self.o: A = None
        self.u: D = None
        self.p: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: F = None
        self.s: D = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.o: H = None
        self.p: E = None
        self.v: F = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

b.p = g
b.u = g
b.s = g
b.q = m
b.t = m
b.y = d
b.v = d
b.w = d
b.z = l
f.t = l
f.q = l
f.z = b
f.o = b
f.r = b
f.u = c
f.p = j
g.w = d
g.r = j
g.s = c
g.y = l
c.r = b
c.u = j
c.v = j
c.o = d
c.p = m
c.w = f
m.y = f
m.w = i
m.v = g
j.s = i
j.q = m
j.p = b
i.u = f
d.v = l
l.u = j
assert g.w.v.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.q: E = None
        self.y: H = None
        self.t: E = None
        self.s: C = None
        self.z: I = None
        self.v: H = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: I = None
        self.z: A = None
        self.o: A = None
        self.u: D = None
        self.p: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: F = None
        self.s: D = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.o: H = None
        self.p: E = None
        self.v: F = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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