class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: F = None
        self.x: E = None
        self.v: B = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.o: D = None
        self.r: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.o: D = None
        self.r: D = None
        self.v: C = None
        self.txt = txt

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

m.u = e
m.v = e
m.t = g
m.x = h
m.p = i
e.t = f
e.p = c
e.w = c
e.s = m
f.y = c
f.t = h
f.w = h
f.x = m
c.t = m
c.x = g
h.s = f
h.v = f
i.p = h
i.s = c
i.o = c
i.r = c
i.v = f
g.p = h
g.s = c
g.o = c
g.r = c
g.v = f
assert h.v.x.u.w.t.x.s.txt == "f"