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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.z: F = None
        self.x: G = None
        self.p: F = None
        self.s: G = None
        self.q: F = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.x: A = None
        self.t: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: D = None
        self.r: D = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
b = C("b")
k = D("k")
e = E("e")
g = F("g")
d = G("d")
i = H("i")
l = B("l")

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.z: F = None
        self.x: G = None
        self.p: F = None
        self.s: G = None
        self.q: F = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.x: A = None
        self.t: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: D = None
        self.r: D = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
b = C("b")
k = D("k")
e = E("e")
g = F("g")
d = G("d")
i = H("i")
l = B("l")

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