class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: C = None
        self.q: C = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.y: A = None
        self.r: C = None
        self.x: G = None
        self.o: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.t: E = None
        self.r: F = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: C = None
        self.q: C = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.y: A = None
        self.r: C = None
        self.x: G = None
        self.o: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.t: E = None
        self.r: F = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

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

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

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