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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: G = None
        self.u: C = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.o: B = None
        self.r: B = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: G = None
        self.u: C = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.o: B = None
        self.r: B = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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