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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: A = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: A = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

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