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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.y: G = None
        self.q: F = None
        self.p: I = None
        self.v: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.p: H = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: B = None
        self.x: I = None
        self.t: A = None
        self.z: E = None
        self.q: B = None
        self.v: I = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: G = None
        self.t: F = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: C = None
        self.q: I = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: H = None
        self.v: B = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.y: G = None
        self.q: F = None
        self.p: I = None
        self.v: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.p: H = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: B = None
        self.x: I = None
        self.t: A = None
        self.z: E = None
        self.q: B = None
        self.v: I = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: G = None
        self.t: F = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: C = None
        self.q: I = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: H = None
        self.v: B = None
        self.p: D = None
        self.txt = txt

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

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