class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: B = None
        self.p: C = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

m = A("m")
l = B("l")
d = C("d")
c = D("c")
i = E("i")
g = F("g")
h = E("h")
e = A("e")

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

m = A("m")
l = B("l")
d = C("d")
c = D("c")
i = E("i")
g = F("g")
h = E("h")
e = A("e")

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