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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

i = A("i")
a = B("a")
b = C("b")
h = D("h")
m = E("m")
g = F("g")

i.w = m
i.r = m
i.v = g
i.s = b
i.z = b
i.p = a
a.s = h
a.x = h
a.u = h
a.r = i
b.y = a
h.o = b
h.t = g
h.r = g
m.u = h
g.s = h
g.y = h
g.r = m
assert b.y.r.r.u.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: F = None
        self.r: E = None
        self.s: C = None
        self.z: C = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

i = A("i")
a = B("a")
b = C("b")
h = D("h")
m = E("m")
g = F("g")

i.w = m
i.r = m
i.v = g
i.s = b
i.z = b
i.p = a
a.s = h
a.x = h
a.u = h
a.r = i
b.y = a
h.o = b
h.t = g
h.r = g
m.u = h
g.s = h
g.y = h
g.r = m
assert b.y.r.r.u.o.y.txt == "a"