class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.v: C = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.u: F = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
b = C("b")
i = D("i")
e = E("e")
f = F("f")
m = D("m")

g.y = e
g.r = i
g.v = b
g.w = f
g.x = m
k.q = f
b.r = f
b.w = e
i.z = k
i.q = e
i.u = f
i.r = g
i.t = m
e.s = i
e.x = b
f.y = g
m.z = k
m.q = e
m.u = f
m.r = g
m.t = i
assert i.r.y.s.u.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.v: C = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.u: F = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
b = C("b")
i = D("i")
e = E("e")
f = F("f")
m = D("m")

g.y = e
g.r = i
g.v = b
g.w = f
g.x = m
k.q = f
b.r = f
b.w = e
i.z = k
i.q = e
i.u = f
i.r = g
i.t = m
e.s = i
e.x = b
f.y = g
m.z = k
m.q = e
m.u = f
m.r = g
m.t = i
assert i.r.y.s.u.y.r.txt == "i"