class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: B = None
        self.u: D = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.t: F = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: B = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.t: F = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: B = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

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

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

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