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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.o: B = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: E = None
        self.t: B = None
        self.o: G = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

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

g = A("g")
k = B("k")
b = C("b")
h = D("h")
d = E("d")
j = F("j")
a = G("a")
f = H("f")

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.o: B = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: E = None
        self.t: B = None
        self.o: G = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

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

g = A("g")
k = B("k")
b = C("b")
h = D("h")
d = E("d")
j = F("j")
a = G("a")
f = H("f")

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