class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: H = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.s: B = None
        self.y: G = None
        self.q: C = None
        self.p: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: F = None
        self.s: D = None
        self.u: G = None
        self.p: F = None
        self.q: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.s: B = None
        self.y: G = None
        self.q: C = None
        self.p: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: F = None
        self.s: D = None
        self.u: G = None
        self.p: F = None
        self.q: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

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

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