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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.p: A = None
        self.u: A = None
        self.v: C = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.p: G = None
        self.o: G = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.p: C = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

i = A("i")
f = B("f")
n = C("n")
e = D("e")
l = E("l")
h = F("h")
b = G("b")
d = G("d")
k = E("k")

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.p: A = None
        self.u: A = None
        self.v: C = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.p: G = None
        self.o: G = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.p: C = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

i = A("i")
f = B("f")
n = C("n")
e = D("e")
l = E("l")
h = F("h")
b = G("b")
d = G("d")
k = E("k")

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