class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.v: B = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.v: B = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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